home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch7a < prev    next >
Encoding:
Text File  |  1989-12-21  |  48.8 KB  |  1,604 lines

  1. Subject:  v08i076:  conquer4 - middle earth multi-player game (V4), Patch7a
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  6. Posting-number: Volume 8, Issue 76
  7. Archive-name: conquer4/Patch7a
  8. Patch-To: conquer4: Volume 6, Issue 83-96
  9.  
  10.  
  11.  [[              Patchlevel 7 for Conquer Version 4
  12.  Highlight Enhancements:
  13.        - display improvements; many sub-screens are more consistent,
  14.            and compact.
  15.        - bug fixes; there are many more bug fixes in this patch than
  16.            in prior ones, as I put bug fixing ahead of enhancement.
  17.        - some restrictions changed; the trade screen now shows only
  18.            items up for trade by known nations, and granaries and
  19.            mills are now possible in any sector.
  20.        - fixed up a good deal of the npc code, including some major
  21.            segmentation fault bugs.
  22.        - inflation is slightly adjusted and is now displayed in the
  23.            budget report.
  24.   As always, all of the changes are summarized in the notes.v4 file.
  25.   Conquer is available for anonymous ftp at cs.bu.edu (128.197.2.1)
  26. adam bryant (adb@cs.bu.edu)]]
  27.  
  28. #!/bin/sh
  29. # shar:    Shell Archiver  (v1.22)
  30. #
  31. # This is part 1 of a multipart archive                                    
  32. # do not concatenate these parts, unpack them in order with /bin/sh        
  33. #
  34. #    Run the following text with /bin/sh to create:
  35. #      patchV4.7
  36. #
  37. if test -r s2_seq_.tmp
  38. then echo "Must unpack archives in sequence!"
  39.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  40.      exit 1; fi
  41. echo "x - extracting patchV4.7 (Text)"
  42. sed 's/^X//' << 'SHAR_EOF' > patchV4.7 &&
  43. X*** opatchlevel.h    Tue Dec 12 21:19:37 1989
  44. X--- patchlevel.h    Tue Dec 12 21:20:03 1989
  45. X***************
  46. X*** 1 ****
  47. X! #define PATCHLEVEL    6
  48. X--- 1 ----
  49. X! #define PATCHLEVEL    7
  50. X*** onotes.v4    Tue Dec 12 21:19:36 1989
  51. X--- notes.v4    Tue Dec 12 21:20:04 1989
  52. X***************
  53. X*** 236,245 ****
  54. X--- 236,300 ----
  55. X  181. altered the god_mgk() display routine a little.
  56. X  182. added in a limit of 16% to charity creeping for democracy.
  57. X  183. added a check for a line with a period on it to end mail.
  58. X+ ===4.0 patch number six released => 4.6 =================================
  59. X+ 184. fixed bug in checking of sector population in construction of ships.
  60. X+ 185. fixed bug with reversed if statement in god vegetation redesignation.
  61. X+ 186. adjusted get_god routine to display prompt at bottom of screen only.
  62. X+ 187. adjusted lizard fortress creation routine to increase gold and fort value.
  63. X+ 188. fixed some display bugs with the god_magk() routines.
  64. X+ 189. made spoilrate calculation floating point to avoid overflow.
  65. X+ 190. fixed a bug with checking of password for 'z' command.
  66. X+ 191. made the "DESTROY NATION" message in forms.c not clear screen.
  67. X+ 192. made sure that WYZARD was not removable in random events.
  68. X+ 193. fixed bug with randevent.c calculation of sector locations [D. Brooks]
  69. X+ 194. implemented check to assure that MORE_MONST isn't too strong [R. Caley]
  70. X+ 195. made sure god could destroy of monster nations in forms.c.
  71. X+ 196. moved the 'z' command to the bottom portion of the screen.
  72. X+ 197. fixed bug with get_nname(); accidently allowed up to NAMELTH+1 chars.
  73. X+ 198. adjusted bottom of diplomacy screen to be more like other screens.
  74. X+ 199. made the 'W' prompt appear at the bottom of the screen.
  75. X+ 200. combat.c [636,637]: owner[k] -> UOWNER(k).  [Ken Dalka]
  76. X+ 201. added a break to the nation name detection in main.c [Brad Isley]
  77. X+ 202. fixed mistype of '<' to '>' reports.c (647) [Richard Kennaway]
  78. X+ 203. adjusted calculation of attack bonus cost to avoid overflow [R. Kennaway]
  79. X+ 204. fixed bug in printing nation name, update.c (579) [R. Kennaway]
  80. X+ 205. adjusted output in wdisaster().  [R. Kennaway]
  81. X+ 206. implemented check for limit of 12 in fortification. [should be #define]
  82. X+ 207. removed a number of local variable declarations of country in misc.c.
  83. X+ 208. allow changing of status of other nation is non-unmet.
  84. X+ 209. added the option to change population for god in (r)edesignate command.
  85. X+ 210. added time check on mail lock files to avoid old files lying around.
  86. X+ 211. added ability for god to change combat statuses of nations.    
  87. X+ 212. added time check to lock files as well, (thrice mail lock death time).
  88. X+ 213. fixed bug in prep so that ships do not protect sectors from capture.
  89. X+ 214. fixed overflow bug in GOLDTHRESH jewel purchase during update.
  90. X+ 215. added new method for calculation of MORE_MONSTers (R. Caley)
  91. X+ 216. for the 100th time, made sure that volcano victims are not revealed.
  92. X+ 217. more adjustments to make sure sector locations are correct in randeven.c.
  93. X+ 218. removed restrictions on mill and granary redesignating.
  94. X+ 219. fixed spelling of "rebelion" to "rebellion" in two places in randeven.c.
  95. X+ 220. changed inflation to be a yearly rate (where did I leave my head?).
  96. X+ 221. adjusted offmap() in io.c to be consistent with coffmap().
  97. X+ 222. putzed around in npc.c trying to catch a bug.
  98. X+ 223. recenter new display upon going off screen.
  99. X+ 224. update.c[821]: ">" to ">=" take with exact number of men. [Dave Flowers]
  100. X+ 225. update.c[1017]: "min(" to "max(" (woops!! major typo) [Dave F.]
  101. X+ 226. trade.c: altered visibility of items for sale. [Dave F.]
  102. X+ 227. misc.c[498]: fixed overflow on gold scoring [Kenneth J Dalka]
  103. X+ 228. adjusted inflation calculation in update.c and reports.c.
  104. X+ 229. added the inflation estimation to the budget report.
  105. X+ 230. fixed bug with division of charity by population. [Dave F.]
  106. X+ 231. prevent passage of fleets through hostile cities.
  107. X+ 232. added some checks in npc.c for ownership in drafting in some sectors.
  108. X+ 233. removed destruction of troops on peaks, now that flight is possible.
  109. X+ 234. changed to min zero in attractiveness, now drift will no longer occur
  110. X+     for sectors with "zero" attractiveness.  [Dave F.]
  111. X  
  112. X  -------------------------------------------------------------------------
  113. X  | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V5             |
  114. X  -------------------------------------------------------------------------
  115. X+ o allow god to alter more nation status values... combat bonus, score,
  116. X+     other things.
  117. X  o new functions:
  118. X      - status_value() = returns base values of attack.defend,etc.
  119. X      - sect_movecost() = returns move cost for given unit in given sector.
  120. X*** odata.h    Tue Dec 12 21:19:34 1989
  121. X--- data.h    Tue Dec 12 21:20:05 1989
  122. X***************
  123. X*** 3,8 ****
  124. X--- 3,9 ----
  125. X  /*--------I DO NOT BELIEVE IT IS NECESSARY TO ALTER THIS FILE----------------*/
  126. X  #define    FAIL    1        /* fail return to shell            */
  127. X  #define    SUCCESS    0        /* successful return to shell        */
  128. X+ #define TIME_DEAD    3600    /* number of seconds for file aging    */
  129. X  #define    BIG    500000000L    /* BIGGER THAN ANYTHING SHOULD BE    */
  130. X                  /* this is used to protect against overflow */
  131. X  #define    SCRARM    ((LINES-14)/2)    /* number of armies to fit on screen    */
  132. X***************
  133. X*** 203,209 ****
  134. X      long    people;            /* civilians in sector        */
  135. X      short    i_people;        /* initial civilians in sector    */
  136. X      unsigned char    jewels;        /* jewel production ability    */
  137. X!     unsigned char    fortress;    /* fortification level (0 to 9)    */
  138. X      unsigned char    metal;        /* metal produced by sector    */
  139. X      unsigned char    tradegood;    /* exotic trade goods in sector    */
  140. X      /* unsigned char    region;        /* index of region    */
  141. X--- 204,210 ----
  142. X      long    people;            /* civilians in sector        */
  143. X      short    i_people;        /* initial civilians in sector    */
  144. X      unsigned char    jewels;        /* jewel production ability    */
  145. X!     unsigned char    fortress;    /* fortification level; 0 to 12    */
  146. X      unsigned char    metal;        /* metal produced by sector    */
  147. X      unsigned char    tradegood;    /* exotic trade goods in sector    */
  148. X      /* unsigned char    region;        /* index of region    */
  149. X*** omakeworl.c    Tue Dec 12 21:19:35 1989
  150. X--- makeworl.c    Tue Dec 12 21:20:06 1989
  151. X***************
  152. X*** 1015,1024 ****
  153. X              nlizards--;
  154. X              sct[x][y].designation = DFORT;
  155. X              sct[x][y].metal = 0;
  156. X!             sct[x][y].jewels = 8 + (i=rand()%20);
  157. X              sct[x][y].tradegood = TG_platinum;
  158. X              /* make fortificaton consistant with gold */
  159. X!             sct[x][y].fortress = 5+i/4;
  160. X              for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  161. X                  if((ONMAP(i,j))&&(sct[i][j].altitude!=WATER))
  162. X                      sct[i][j].owner = country;
  163. X--- 1015,1024 ----
  164. X              nlizards--;
  165. X              sct[x][y].designation = DFORT;
  166. X              sct[x][y].metal = 0;
  167. X!             sct[x][y].jewels = 8 + (i=rand()%30);
  168. X              sct[x][y].tradegood = TG_platinum;
  169. X              /* make fortificaton consistant with gold */
  170. X!             sct[x][y].fortress = 6+i/5;
  171. X              for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  172. X                  if((ONMAP(i,j))&&(sct[i][j].altitude!=WATER))
  173. X                      sct[i][j].owner = country;
  174. X*** orandeven.c    Tue Dec 12 21:19:37 1989
  175. X--- randeven.c    Tue Dec 12 21:20:06 1989
  176. X***************
  177. X*** 23,29 ****
  178. X  /* 2 */  "a province rebels",
  179. X  /* 3 */  "an evil wizard sets up",
  180. X  /* 4 */  "a tax revolt occurs",
  181. X! /* 5 */  "open rebelion flares",
  182. X  /* 6 */  "an army revolts",
  183. X  /* 7 */  "religions schism",
  184. X  /* 8 */  "peasants revolt",
  185. X--- 23,29 ----
  186. X  /* 2 */  "a province rebels",
  187. X  /* 3 */  "an evil wizard sets up",
  188. X  /* 4 */  "a tax revolt occurs",
  189. X! /* 5 */  "open rebellion flares",
  190. X  /* 6 */  "an army revolts",
  191. X  /* 7 */  "religions schism",
  192. X  /* 8 */  "peasants revolt",
  193. X***************
  194. X*** 493,498 ****
  195. X--- 493,501 ----
  196. X                      done=TRUE;
  197. X                  }
  198. X              }
  199. X+             /* decrement to contain proper value */
  200. X+             xpos--;
  201. X+             ypos--;
  202. X              break;
  203. X          case 19:
  204. X          case 20:
  205. X***************
  206. X*** 519,524 ****
  207. X--- 522,530 ----
  208. X                      sct[xpos][ypos].jewels = 0;
  209. X                  }
  210. X              }
  211. X+             /* decrement to contain proper value */
  212. X+             xpos--;
  213. X+             ypos--;
  214. X              break;
  215. X          case 21:
  216. X              /*flood*/
  217. X***************
  218. X*** 622,627 ****
  219. X--- 628,636 ----
  220. X                  }
  221. X              }
  222. X              break;
  223. X+             /* decrement to contain proper value */
  224. X+             xpos--;
  225. X+             ypos--;
  226. X          case 27:
  227. X              /*plague -- 40% of populace in cities dies*/
  228. X              strcpy(eventstr,"40% of populace & armies in towns die");
  229. X***************
  230. X*** 695,700 ****
  231. X--- 704,712 ----
  232. X                      done=TRUE;
  233. X                  }
  234. X              }
  235. X+             /* decrement to contain proper value */
  236. X+             xpos--;
  237. X+             ypos--;
  238. X              break;
  239. X          case 33:
  240. X              /*new architect strengthens castle walls */
  241. X***************
  242. X*** 728,736 ****
  243. X                      break;
  244. X                  }
  245. X              }
  246. X              break;
  247. X          case 35:
  248. X!             /*new leader sets up peace*/
  249. X              for(newnation=0;newnation<NTOTAL;newnation++) 
  250. X              if(( country!=newnation ) 
  251. X              &&( isntn( ntn[newnation].active ))
  252. X--- 740,751 ----
  253. X                      break;
  254. X                  }
  255. X              }
  256. X+             /* decrement to contain proper value */
  257. X+             xpos--;
  258. X+             ypos--;
  259. X              break;
  260. X          case 35:
  261. X!             /*diplomat sets up peace*/
  262. X              for(newnation=0;newnation<NTOTAL;newnation++) 
  263. X              if(( country!=newnation ) 
  264. X              &&( isntn( ntn[newnation].active ))
  265. X***************
  266. X*** 816,821 ****
  267. X--- 831,837 ----
  268. X              switch(curntn->class) {
  269. X              case C_WIZARD:
  270. X                  if(newpower==SUMMON) done=FALSE;
  271. X+                 if(newpower==WYZARD) done=FALSE;
  272. X                  break;
  273. X              case C_PRIEST:
  274. X                  if(newpower==RELIGION) done=FALSE;
  275. X***************
  276. X*** 918,924 ****
  277. X      if(strlen(eventstr)>5) {
  278. X  #ifdef HIDELOC
  279. X          /* make sure that volcano locations are not revealed */
  280. X!         if(strcmp(eventstr,"volcano erupted")!=0)
  281. X  #endif HIDELOC
  282. X          fprintf(fnews,"1. \tevent in %s -->%s\n",ntn[cntry].name,eventstr);
  283. X  #ifndef HIDELOC
  284. X--- 934,940 ----
  285. X      if(strlen(eventstr)>5) {
  286. X  #ifdef HIDELOC
  287. X          /* make sure that volcano locations are not revealed */
  288. X!         if(strcmp(eventstr,"all flee, 30%% die in 1 sector range")!=0)
  289. X  #endif HIDELOC
  290. X          fprintf(fnews,"1. \tevent in %s -->%s\n",ntn[cntry].name,eventstr);
  291. X  #ifndef HIDELOC
  292. X***************
  293. X*** 994,1000 ****
  294. X      case 4: /* tax revolt */
  295. X          if((*new=disolve(20, country, FALSE))!=0) return(reason);
  296. X          break;
  297. X!     case 5: /* open rebelion */
  298. X          if((*new=disolve(30, country, FALSE))!=0) return(reason);
  299. X          break;
  300. X      case 6: /* general takes over province*/
  301. X--- 1010,1016 ----
  302. X      case 4: /* tax revolt */
  303. X          if((*new=disolve(20, country, FALSE))!=0) return(reason);
  304. X          break;
  305. X!     case 5: /* open rebellion */
  306. X          if((*new=disolve(30, country, FALSE))!=0) return(reason);
  307. X          break;
  308. X      case 6: /* general takes over province*/
  309. X*** ocexecute.c    Tue Dec 12 21:19:34 1989
  310. X--- cexecute.c    Tue Dec 12 21:20:07 1989
  311. X***************
  312. X*** 293,313 ****
  313. X      }
  314. X      /*close file*/
  315. X      fclose(fexe);
  316. X-     /*send a message to God*/
  317. X-     if(mailopen( 0 )!=(-1)) {
  318. X-         fprintf(fm,"WARNING: Nation %s hungup on me.\n",curntn->name);
  319. X-         mailclose(0);
  320. X-     }
  321. X  
  322. X-     /* remove the lock file */
  323. X-     unlink(fison);
  324. X      /* remove any existing mail reading/writing file */
  325. X      if (mailok!=DONEMAIL) {
  326. X          extern char tmp_mail_name[];
  327. X          unlink(tmp_mail_name);
  328. X      }
  329. X      sprintf(line,"%s%hd.tmp",msgfile,country);
  330. X      unlink(line);
  331. X      /* exit program */
  332. X      exit(FAIL);
  333. X  }
  334. X--- 293,316 ----
  335. X      }
  336. X      /*close file*/
  337. X      fclose(fexe);
  338. X  
  339. X      /* remove any existing mail reading/writing file */
  340. X      if (mailok!=DONEMAIL) {
  341. X          extern char tmp_mail_name[];
  342. X          unlink(tmp_mail_name);
  343. X      }
  344. X+ 
  345. X+     /* remove the lock file */
  346. X+     unlink(fison);
  347. X      sprintf(line,"%s%hd.tmp",msgfile,country);
  348. X      unlink(line);
  349. X+ 
  350. X+     /*send a message to God*/
  351. X+     if(mailopen( 0 )!=(-1)) {
  352. X+         fprintf(fm,"WARNING: Nation %s hungup on me.\n",curntn->name);
  353. X+         mailclose(0);
  354. X+     }
  355. X+ 
  356. X      /* exit program */
  357. X      exit(FAIL);
  358. X  }
  359. X*** oforms.c    Tue Dec 12 21:19:35 1989
  360. X--- forms.c    Tue Dec 12 21:20:07 1989
  361. X***************
  362. X*** 185,193 ****
  363. X  
  364. X          /* display options */
  365. X          standout();
  366. X!         mvaddstr(LINES-7,0,"HIT RETURN KEY TO CHANGE STATUS; HIT SPACE IF DONE");
  367. X!         mvprintw(LINES-6,0,"HIT 'B' KEY TO BRIBE NPC NATION (cost=$%ld per 1000 Mil.)",BRIBE);
  368. X!         mvaddstr(LINES-5,0,"ANY OTHER KEY TO CONTINUE:");
  369. X          standend();
  370. X          refresh();
  371. X          k=getch();
  372. X--- 185,193 ----
  373. X  
  374. X          /* display options */
  375. X          standout();
  376. X!         mvaddstr(LINES-7,COLS/2-26,"HIT RETURN KEY TO CHANGE STATUS; HIT SPACE IF DONE");
  377. X!         mvprintw(LINES-6,COLS/2-31,"HIT 'B' KEY TO BRIBE NPC NATION (cost=$%ld per 1000 Mil.)",BRIBE);
  378. X!         mvaddstr(LINES-5,COLS/2-21,"HIT ANY OTHER KEY TO SCROLL NATIONS LIST");
  379. X          standend();
  380. X          refresh();
  381. X          k=getch();
  382. X***************
  383. X*** 219,230 ****
  384. X              if((nation<=0)
  385. X              ||(nation>=NTOTAL)
  386. X              ||(!isnpc(ntn[nation].active))){
  387. X!                 errormsg("NOT NON PLAYER COUNTRY");
  388. X                  if(isgod==TRUE) reset_god();
  389. X                  return;
  390. X              }
  391. X!             if(ntn[country].dstatus[nation]==UNMET){
  392. X!                 errormsg("YOU HAVE NOT MET COUNTRY");
  393. X                  if(isgod==TRUE) reset_god();
  394. X                  return;
  395. X              }
  396. X--- 219,230 ----
  397. X              if((nation<=0)
  398. X              ||(nation>=NTOTAL)
  399. X              ||(!isnpc(ntn[nation].active))){
  400. X!                 errormsg("That nation is not a Non-Player Country");
  401. X                  if(isgod==TRUE) reset_god();
  402. X                  return;
  403. X              }
  404. X!             if(ntn[nation].dstatus[country]==UNMET){
  405. X!                 errormsg("They have no knowledge that you exist");
  406. X                  if(isgod==TRUE) reset_god();
  407. X                  return;
  408. X              }
  409. X***************
  410. X*** 233,239 ****
  411. X                  ||(ntn[nation].dstatus[country]==JIHAD)
  412. X                  ||(ntn[nation].dstatus[country]==UNMET)
  413. X                  ||(ntn[nation].dstatus[country]==TREATY))){
  414. X!                 errormsg("Sorry, you can't bribe them");
  415. X                  return;
  416. X              }
  417. X  
  418. X--- 233,239 ----
  419. X                  ||(ntn[nation].dstatus[country]==JIHAD)
  420. X                  ||(ntn[nation].dstatus[country]==UNMET)
  421. X                  ||(ntn[nation].dstatus[country]==TREATY))){
  422. X!                 errormsg("Sorry, you cannot bribe them");
  423. X                  return;
  424. X              }
  425. X  
  426. X***************
  427. X*** 286,292 ****
  428. X              getch();
  429. X              if(isgod==TRUE) reset_god();
  430. X              return;
  431. X!         } else if (isgod==FALSE && curntn->dstatus[nation]==UNMET) {
  432. X              errormsg("Sorry, you have not met that nation yet.");
  433. X              if(isgod==TRUE) reset_god();
  434. X              return;
  435. X--- 286,293 ----
  436. X              getch();
  437. X              if(isgod==TRUE) reset_god();
  438. X              return;
  439. X!         } else if (isgod==FALSE && curntn->dstatus[nation]==UNMET
  440. X!         && ntn[nation].dstatus[country]==UNMET) {
  441. X              errormsg("Sorry, you have not met that nation yet.");
  442. X              if(isgod==TRUE) reset_god();
  443. X              return;
  444. X***************
  445. X*** 481,488 ****
  446. X      standout();
  447. X      mvaddstr(LINES-6,COLS/2-26,"HIT 'B' FOR BUDGET SCREEN, 'P' FOR PRODUCTION SCREEN");
  448. X      mvaddstr(LINES-5,COLS/2-25,"1) NAME 2) PASSWD 3) TAX RATE 4) CHARITY 5) TERROR");
  449. X!     if(magic(country,VAMPIRE)!=1)
  450. X!         mvaddstr(LINES-4,COLS/2-21,"6) ADD TO COMBAT BONUS");
  451. X      else    mvaddstr(LINES-4,COLS/2-22,"CANT ADD TO COMBAT BONUS");
  452. X      addstr(" 7) TOGGLE PC <-> NPC");
  453. X  
  454. X--- 482,489 ----
  455. X      standout();
  456. X      mvaddstr(LINES-6,COLS/2-26,"HIT 'B' FOR BUDGET SCREEN, 'P' FOR PRODUCTION SCREEN");
  457. X      mvaddstr(LINES-5,COLS/2-25,"1) NAME 2) PASSWD 3) TAX RATE 4) CHARITY 5) TERROR");
  458. X!     if(magic(country,VAMPIRE)!=1 || isgod==TRUE)
  459. X!         mvaddstr(LINES-4,COLS/2-21,"6) ADJUST TO COMBAT BONUS");
  460. X      else    mvaddstr(LINES-4,COLS/2-22,"CANT ADD TO COMBAT BONUS");
  461. X      addstr(" 7) TOGGLE PC <-> NPC");
  462. X  
  463. X***************
  464. X*** 618,623 ****
  465. X--- 619,642 ----
  466. X          }
  467. X          break;
  468. X      case '6':    /* combat bonus */
  469. X+ #ifdef OGOD
  470. X+         if(isgod==TRUE) {
  471. X+             mvaddstr(LINES-2,0,"SUPER-USER: Change (A)ttack or (D)efense Bonus? ");
  472. X+             refresh();
  473. X+             if ((intval=getch())=='A' || intval=='a')  {
  474. X+                 mvaddstr(LINES-1,0,"Enter new value for Attack Bonus: ");
  475. X+                 refresh();
  476. X+                 curntn->aplus = get_number();
  477. X+                 if (curntn->aplus < 0) curntn->aplus = 0;
  478. X+             } else if (intval=='d' || intval == 'D') {
  479. X+                 mvaddstr(LINES-1,0,"Enter new value for Defense Bonus: ");
  480. X+                 refresh();
  481. X+                 curntn->dplus = get_number();
  482. X+                 if (curntn->dplus < 0) curntn->dplus = 0;
  483. X+             }
  484. X+             break;
  485. X+         }
  486. X+ #endif /*OGOD*/
  487. X          if(magic(country,VAMPIRE)==1) {
  488. X              errormsg("VAMPIRES CAN'T ADD TO COMBAT BONUS");
  489. X              break;
  490. X***************
  491. X*** 630,637 ****
  492. X          for(armynum=0;armynum<MAXARM;armynum++)
  493. X              if((P_ASOLD>0)&&(P_ATYPE<MINLEADER)) men+=P_ASOLD;
  494. X          men = max( men, 1500);
  495. X!         armynum = max( curntn->aplus-intval, 10 );
  496. X!         cost = METALORE*men*armynum*armynum/100;
  497. X          if( curntn->race == ORC) cost*=3;
  498. X          mvprintw(LINES-1,0,"Do You Wish Spend %ld Metal On Attack (enter y or n):",cost);
  499. X          refresh();
  500. X--- 649,656 ----
  501. X          for(armynum=0;armynum<MAXARM;armynum++)
  502. X              if((P_ASOLD>0)&&(P_ATYPE<MINLEADER)) men+=P_ASOLD;
  503. X          men = max( men, 1500);
  504. X!         armynum = max( curntn->aplus-intval, 10 ) / 10;
  505. X!         cost = METALORE*men*armynum*armynum;
  506. X          if( curntn->race == ORC) cost*=3;
  507. X          mvprintw(LINES-1,0,"Do You Wish Spend %ld Metal On Attack (enter y or n):",cost);
  508. X          refresh();
  509. X***************
  510. X*** 671,678 ****
  511. X          break;
  512. X      case '8':
  513. X          if(isgod==TRUE){
  514. X!             clear();
  515. X              mvaddstr(LINES-1,0,"DO YOU WANT TO DESTROY THIS NATION (y or n)");
  516. X              refresh();
  517. X  
  518. X              if(getch()=='y') {
  519. X--- 690,698 ----
  520. X          break;
  521. X      case '8':
  522. X          if(isgod==TRUE){
  523. X!             standout();
  524. X              mvaddstr(LINES-1,0,"DO YOU WANT TO DESTROY THIS NATION (y or n)");
  525. X+             standend();
  526. X              refresh();
  527. X  
  528. X              if(getch()=='y') {
  529. X*** omisc.c    Tue Dec 12 21:19:36 1989
  530. X--- misc.c    Tue Dec 12 21:20:07 1989
  531. X***************
  532. X*** 1,11 ****
  533. X  /* Conquer: Copyright (c) 1988 by Edward M Barlow */
  534. X  #include    <ctype.h>
  535. X  #include    <stdio.h>
  536. X  #include    "header.h"
  537. X  #include    "data.h"
  538. X  
  539. X  extern FILE *fnews;
  540. X! extern short country;
  541. X  
  542. X  extern char *HVegcost, *OVegcost, *EVegcost, *DVegcost, *FVegcost;
  543. X  extern char *HElecost, *OElecost, *EElecost, *DElecost, *FElecost;
  544. X--- 1,15 ----
  545. X  /* Conquer: Copyright (c) 1988 by Edward M Barlow */
  546. X  #include    <ctype.h>
  547. X  #include    <stdio.h>
  548. X+ #ifdef CONQUER
  549. X+ #include    <sys/types.h>
  550. X+ #include    <sys/stat.h>
  551. X+ #endif /*CONQUER*/
  552. X  #include    "header.h"
  553. X  #include    "data.h"
  554. X  
  555. X  extern FILE *fnews;
  556. X! extern short country,redraw;
  557. X  
  558. X  extern char *HVegcost, *OVegcost, *EVegcost, *DVegcost, *FVegcost;
  559. X  extern char *HElecost, *OElecost, *EElecost, *DElecost, *FElecost;
  560. X***************
  561. X*** 431,442 ****
  562. X   */
  563. X  
  564. X  long
  565. X! solds_in_sector( x, y, country )
  566. X  int    x;
  567. X  int    y;
  568. X! int    country;
  569. X  {
  570. X!     register struct s_nation    *nptr = &ntn[country];
  571. X      register int    j;
  572. X      long    total = 0;
  573. X  
  574. X--- 435,446 ----
  575. X   */
  576. X  
  577. X  long
  578. X! solds_in_sector( x, y, nation )
  579. X  int    x;
  580. X  int    y;
  581. X! int    nation;
  582. X  {
  583. X!     register struct s_nation    *nptr = &ntn[nation];
  584. X      register int    j;
  585. X      long    total = 0;
  586. X  
  587. X***************
  588. X*** 480,489 ****
  589. X  };
  590. X  
  591. X  long
  592. X! score_one( country )
  593. X! int    country;
  594. X  {
  595. X!     struct    s_nation    *nptr = &ntn[ country ];
  596. X      long    total = 0;
  597. X      int    bonus;
  598. X      struct    wght    *wght = &weights[ nptr->class ];
  599. X--- 484,493 ----
  600. X  };
  601. X  
  602. X  long
  603. X! score_one( nation )
  604. X! int    nation;
  605. X  {
  606. X!     struct    s_nation    *nptr = &ntn[ nation ];
  607. X      long    total = 0;
  608. X      int    bonus;
  609. X      struct    wght    *wght = &weights[ nptr->class ];
  610. X***************
  611. X*** 491,533 ****
  612. X      total += wght->sectors * nptr->tsctrs / 2L;
  613. X      total += wght->civilians * nptr->tciv / 1000L;
  614. X      total += wght->soldiers * nptr->tmil / 1000L;
  615. X!     if(nptr->tgold > 0 ) total += wght->gold * nptr->tgold / 100000L;
  616. X      total += wght->jewels * nptr->jewels / 100000L;
  617. X      total += wght->metal * nptr->metals / 100000L;
  618. X!     total += wght->magics * num_powers(country,M_MIL);
  619. X!     total += wght->magics * num_powers(country,M_CIV);
  620. X!     total += wght->magics * num_powers(country,M_MGK);
  621. X      total += wght->ships * nptr->tships / 10L;
  622. X      switch( nptr->class ) {
  623. X      case     C_KING:
  624. X!             bonus=(curntn->popularity+curntn->prestige-curntn->poverty);
  625. X              break;
  626. X      case    C_EMPEROR:
  627. X!             bonus=(curntn->power+curntn->prestige-curntn->poverty);
  628. X              break;
  629. X      case    C_WIZARD:
  630. X!             bonus=(curntn->knowledge+curntn->power-50);
  631. X              break;
  632. X      case    C_PRIEST:
  633. X!             bonus=(curntn->wealth+curntn->terror-curntn->poverty);
  634. X              break;
  635. X      case    C_PIRATE:
  636. X!             bonus=(curntn->reputation+curntn->wealth-50);
  637. X              break;
  638. X      case    C_TRADER:
  639. X!             bonus=(curntn->wealth+curntn->prestige-curntn->tax_rate*5);
  640. X              break;
  641. X      case    C_WARLORD:
  642. X!             bonus=(curntn->reputation+curntn->prestige-50);
  643. X              break;
  644. X      case    C_DEMON    :
  645. X!             bonus=(curntn->knowledge+curntn->terror-50);
  646. X              break;
  647. X      case    C_DRAGON:
  648. X!             bonus=(curntn->wealth+curntn->terror-50);
  649. X              break;
  650. X      case    C_SHADOW:
  651. X!             bonus=(curntn->power+curntn->terror-50);
  652. X              break;
  653. X      default:    bonus=0;
  654. X      }
  655. X--- 495,537 ----
  656. X      total += wght->sectors * nptr->tsctrs / 2L;
  657. X      total += wght->civilians * nptr->tciv / 1000L;
  658. X      total += wght->soldiers * nptr->tmil / 1000L;
  659. X!     if(nptr->tgold > 0 ) total += wght->gold * (nptr->tgold / 100000L);
  660. X      total += wght->jewels * nptr->jewels / 100000L;
  661. X      total += wght->metal * nptr->metals / 100000L;
  662. X!     total += wght->magics * num_powers(nation,M_MIL);
  663. X!     total += wght->magics * num_powers(nation,M_CIV);
  664. X!     total += wght->magics * num_powers(nation,M_MGK);
  665. X      total += wght->ships * nptr->tships / 10L;
  666. X      switch( nptr->class ) {
  667. X      case     C_KING:
  668. X!             bonus=(nptr->popularity+nptr->prestige-nptr->poverty);
  669. X              break;
  670. X      case    C_EMPEROR:
  671. X!             bonus=(nptr->power+nptr->prestige-nptr->poverty);
  672. X              break;
  673. X      case    C_WIZARD:
  674. X!             bonus=(nptr->knowledge+nptr->power-50);
  675. X              break;
  676. X      case    C_PRIEST:
  677. X!             bonus=(nptr->wealth+nptr->terror-nptr->poverty);
  678. X              break;
  679. X      case    C_PIRATE:
  680. X!             bonus=(nptr->reputation+nptr->wealth-50);
  681. X              break;
  682. X      case    C_TRADER:
  683. X!             bonus=(nptr->wealth+nptr->prestige-nptr->tax_rate*5);
  684. X              break;
  685. X      case    C_WARLORD:
  686. X!             bonus=(nptr->reputation+nptr->prestige-50);
  687. X              break;
  688. X      case    C_DEMON    :
  689. X!             bonus=(nptr->knowledge+nptr->terror-50);
  690. X              break;
  691. X      case    C_DRAGON:
  692. X!             bonus=(nptr->wealth+nptr->terror-50);
  693. X              break;
  694. X      case    C_SHADOW:
  695. X!             bonus=(nptr->power+nptr->terror-50);
  696. X              break;
  697. X      default:    bonus=0;
  698. X      }
  699. X***************
  700. X*** 564,585 ****
  701. X  
  702. X  #ifdef CONQUER
  703. X  int
  704. X! units_in_sector(x,y,country)
  705. X  int    x;
  706. X  int    y;
  707. X  {
  708. X      int count=0, armynum, nvynum;
  709. X      for(armynum=0;armynum<MAXARM;armynum++)
  710. X!         if((ASOLD>0)&&(AXLOC==x)&&(AYLOC==y)) count++;
  711. X      for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  712. X!         if(((NWSHP+NMSHP+NGSHP)!=0)&&(NXLOC==x)&&(NYLOC==y)) count++;
  713. X      return(count);
  714. X  }
  715. X  #endif CONQUER
  716. X  
  717. X  int
  718. X! num_powers(country,type)
  719. X! int country,type;
  720. X  {
  721. X      int    count_magic=0;
  722. X      int    try;
  723. X--- 568,595 ----
  724. X  
  725. X  #ifdef CONQUER
  726. X  int
  727. X! units_in_sector(x,y,nation)
  728. X  int    x;
  729. X  int    y;
  730. X  {
  731. X      int count=0, armynum, nvynum;
  732. X+     struct    s_nation  *nptr = curntn;
  733. X+ 
  734. X+     curntn = &ntn[nation];
  735. X      for(armynum=0;armynum<MAXARM;armynum++)
  736. X!         if((P_ASOLD>0)&&(P_AXLOC==x)&&(P_AYLOC==y)) count++;
  737. X      for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  738. X!         if(((P_NWSHP+P_NMSHP+P_NGSHP)!=0)&&
  739. X!         (P_NXLOC==x)&&(P_NYLOC==y)) count++;
  740. X! 
  741. X!     curntn = nptr;
  742. X      return(count);
  743. X  }
  744. X  #endif CONQUER
  745. X  
  746. X  int
  747. X! num_powers(nation,type)
  748. X! int nation,type;
  749. X  {
  750. X      int    count_magic=0;
  751. X      int    try;
  752. X***************
  753. X*** 602,612 ****
  754. X              end=E_MGK;
  755. X              break;
  756. X          default:
  757. X!             printf("fatal error in num_powers");
  758. X              abrt();
  759. X      }
  760. X      for( try = start; try < start+end; try++ )
  761. X!         if( magic(country, powers[try] ) == 1 ) count_magic++;
  762. X      return(count_magic);
  763. X  }
  764. X  
  765. X--- 612,622 ----
  766. X              end=E_MGK;
  767. X              break;
  768. X          default:
  769. X!             fprintf(stderr,"fatal error in num_powers");
  770. X              abrt();
  771. X      }
  772. X      for( try = start; try < start+end; try++ )
  773. X!         if( magic(nation, powers[try] ) == 1 ) count_magic++;
  774. X      return(count_magic);
  775. X  }
  776. X  
  777. X***************
  778. X*** 650,657 ****
  779. X  
  780. X  /* returns cost of magic power - returns -1 if invalid */
  781. X  long
  782. X! getmgkcost(type,country)
  783. X! int type, country;
  784. X  {
  785. X      int i;
  786. X      long cost;
  787. X--- 660,667 ----
  788. X  
  789. X  /* returns cost of magic power - returns -1 if invalid */
  790. X  long
  791. X! getmgkcost(type,nation)
  792. X! int type, nation;
  793. X  {
  794. X      int i;
  795. X      long cost;
  796. X***************
  797. X*** 659,684 ****
  798. X      int npowers;
  799. X      switch(type) {
  800. X      case M_MGK:
  801. X!         if(ntn[country].race==DWARF)        base=DWFMAGIC;
  802. X!         else if(ntn[country].race==HUMAN)    base=HUMMAGIC;
  803. X!         else if(ntn[country].race==ORC)        base=ORCMAGIC;
  804. X!         npowers=num_powers(country,M_CIV)+num_powers(country,M_MIL)+1
  805. X!         +2*num_powers(country,M_MGK);
  806. X          npowers/=2;
  807. X          break;
  808. X      case M_CIV:
  809. X!         if(ntn[country].race==DWARF)        base=DWFCIVIL;
  810. X!         else if(ntn[country].race==HUMAN)    base=HUMCIVIL;
  811. X!         else if(ntn[country].race==ORC)        base=ORCCIVIL;
  812. X!         npowers=num_powers(country,M_MGK)+num_powers(country,M_MIL)+1
  813. X!         +2*num_powers(country,M_CIV);
  814. X          npowers/=2;
  815. X          break;
  816. X      case M_MIL:
  817. X!         if(ntn[country].race==DWARF)        base=DWFMILIT;
  818. X!         else if(ntn[country].race==ORC)        base=ORCMILIT;
  819. X!         npowers=num_powers(country,M_CIV)+num_powers(country,M_MGK)+1
  820. X!         +2*num_powers(country,M_MIL);
  821. X          npowers/=2;
  822. X          break;
  823. X      default:
  824. X--- 669,694 ----
  825. X      int npowers;
  826. X      switch(type) {
  827. X      case M_MGK:
  828. X!         if(ntn[nation].race==DWARF)        base=DWFMAGIC;
  829. X!         else if(ntn[nation].race==HUMAN)    base=HUMMAGIC;
  830. X!         else if(ntn[nation].race==ORC)        base=ORCMAGIC;
  831. X!         npowers=num_powers(nation,M_CIV)+num_powers(nation,M_MIL)+1
  832. X!         +2*num_powers(nation,M_MGK);
  833. X          npowers/=2;
  834. X          break;
  835. X      case M_CIV:
  836. X!         if(ntn[nation].race==DWARF)        base=DWFCIVIL;
  837. X!         else if(ntn[nation].race==HUMAN)    base=HUMCIVIL;
  838. X!         else if(ntn[nation].race==ORC)        base=ORCCIVIL;
  839. X!         npowers=num_powers(nation,M_MGK)+num_powers(nation,M_MIL)+1
  840. X!         +2*num_powers(nation,M_CIV);
  841. X          npowers/=2;
  842. X          break;
  843. X      case M_MIL:
  844. X!         if(ntn[nation].race==DWARF)        base=DWFMILIT;
  845. X!         else if(ntn[nation].race==ORC)        base=ORCMILIT;
  846. X!         npowers=num_powers(nation,M_CIV)+num_powers(nation,M_MGK)+1
  847. X!         +2*num_powers(nation,M_MIL);
  848. X          npowers/=2;
  849. X          break;
  850. X      default:
  851. X***************
  852. X*** 704,714 ****
  853. X  
  854. X  /* set up occ[][] for country.
  855. X   * if leader==true, only for leader sectors plus ntn.communicatins range
  856. X!  * if shipchk==true, include ships on the sector search
  857. X   */
  858. X  void
  859. X! prep(country,leader)
  860. X! int country,leader;
  861. X  {
  862. X      short armynum,nvynum;
  863. X      int save,i,j,x,y,start,end,com;
  864. X--- 714,724 ----
  865. X  
  866. X  /* set up occ[][] for country.
  867. X   * if leader==true, only for leader sectors plus ntn.communicatins range
  868. X!  * if leader==(-1), do not include ships on the sector search
  869. X   */
  870. X  void
  871. X! prep(nation,leader)
  872. X! int nation,leader;
  873. X  {
  874. X      short armynum,nvynum;
  875. X      int save,i,j,x,y,start,end,com;
  876. X***************
  877. X*** 716,723 ****
  878. X      /*set occ to 0*/
  879. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++) occ[i][j]=0;
  880. X  
  881. X!     save=country;
  882. X!     if(leader) {
  883. X          /* only do the given country */
  884. X          start=save;
  885. X          end=save+1;
  886. X--- 726,733 ----
  887. X      /*set occ to 0*/
  888. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++) occ[i][j]=0;
  889. X  
  890. X!     save=nation;
  891. X!     if(leader==TRUE) {
  892. X          /* only do the given country */
  893. X          start=save;
  894. X          end=save+1;
  895. X***************
  896. X*** 728,737 ****
  897. X      }
  898. X  
  899. X      /*set occ to country of occupant army*/
  900. X!     for(country=start;country<end;country++) if(ntn[country].active!=INACTIVE) {
  901. X!         curntn = &ntn[country];
  902. X          for(armynum=0;armynum<MAXARM;armynum++){
  903. X!             if( leader ) {
  904. X                  if((P_ATYPE<MINLEADER)
  905. X                  ||(P_ATYPE>=MINMONSTER)
  906. X                  ||(P_ASOLD<=0)) continue;
  907. X--- 738,747 ----
  908. X      }
  909. X  
  910. X      /*set occ to country of occupant army*/
  911. X!     for(nation=start;nation<end;nation++) if(ntn[nation].active!=INACTIVE) {
  912. X!         curntn = &ntn[nation];
  913. X          for(armynum=0;armynum<MAXARM;armynum++){
  914. X!             if( leader==TRUE ) {
  915. X                  if((P_ATYPE<MINLEADER)
  916. X                  ||(P_ATYPE>=MINMONSTER)
  917. X                  ||(P_ASOLD<=0)) continue;
  918. X***************
  919. X*** 740,786 ****
  920. X                  com = P_NTNCOM; /* do communications radius */
  921. X                  for(x=i-com;x<=i+com;x++)
  922. X                  for(y=j-com;y<=j+com;y++)
  923. X!                     if(ONMAP(x,y)) occ[x][y]=country;
  924. X              } else if((P_ASOLD>0)&&(P_ASTAT!=SCOUT)){
  925. X                  i=P_AXLOC;
  926. X                  j=P_AYLOC;
  927. X!                 if((occ[i][j]== 0)||(occ[i][j]== country))
  928. X!                     occ[i][j]= country;
  929. X                  else occ[i][j]= NTOTAL;
  930. X              }
  931. X          }
  932. X!         if( !leader ) for(nvynum=0;nvynum<MAXNAVY;nvynum++){
  933. X              if((P_NWSHP!=0)||(P_NGSHP!=0)||(P_NMSHP!=0)){
  934. X                  i=P_NXLOC;
  935. X                  j=P_NYLOC;
  936. X!                 if((occ[i][j]== 0)||(occ[i][j]== country))
  937. X!                     occ[i][j]= country;
  938. X                  else occ[i][j]= NTOTAL;
  939. X              }
  940. X          }
  941. X      }
  942. X  
  943. X!     country=save;
  944. X!     curntn = &ntn[country];
  945. X  }
  946. X  
  947. X  #ifdef ADMIN
  948. X  /*routine to depelete a nation without a capitol */
  949. X  void
  950. X! deplete(country)
  951. X! int country;
  952. X  {
  953. X      struct s_nation *saventn=curntn;
  954. X      int i,j,x,y,armynum;
  955. X  
  956. X!     x = ntn[country].capx;
  957. X!     y = ntn[country].capy;
  958. X!     if((sct[x][y].designation==DCAPITOL)&&((sct[x][y].owner==country)
  959. X      ||(sct[x][y].owner==0)||(!isntn(ntn[sct[x][y].owner].active))))
  960. X          return;
  961. X  
  962. X!     curntn = &ntn[country];
  963. X!     fprintf(fnews,"1.\tNation %s is depleted by the lack of a Capitol\n",ntn[country].name);
  964. X  
  965. X      for(armynum=0;armynum<MAXARM;armynum++) if (P_ASOLD>0) {
  966. X          /* first disband PDEPLETE% of the military */
  967. X--- 750,796 ----
  968. X                  com = P_NTNCOM; /* do communications radius */
  969. X                  for(x=i-com;x<=i+com;x++)
  970. X                  for(y=j-com;y<=j+com;y++)
  971. X!                     if(ONMAP(x,y)) occ[x][y]=nation;
  972. X              } else if((P_ASOLD>0)&&(P_ASTAT!=SCOUT)){
  973. X                  i=P_AXLOC;
  974. X                  j=P_AYLOC;
  975. X!                 if((occ[i][j]== 0)||(occ[i][j]== nation))
  976. X!                     occ[i][j]= nation;
  977. X                  else occ[i][j]= NTOTAL;
  978. X              }
  979. X          }
  980. X!         if( leader==FALSE ) for(nvynum=0;nvynum<MAXNAVY;nvynum++){
  981. X              if((P_NWSHP!=0)||(P_NGSHP!=0)||(P_NMSHP!=0)){
  982. X                  i=P_NXLOC;
  983. X                  j=P_NYLOC;
  984. X!                 if((occ[i][j]== 0)||(occ[i][j]== nation))
  985. X!                     occ[i][j]= nation;
  986. X                  else occ[i][j]= NTOTAL;
  987. X              }
  988. X          }
  989. X      }
  990. X  
  991. X!     nation=save;
  992. X!     curntn = &ntn[nation];
  993. X  }
  994. X  
  995. X  #ifdef ADMIN
  996. X  /*routine to depelete a nation without a capitol */
  997. X  void
  998. X! deplete(nation)
  999. X! int nation;
  1000. X  {
  1001. X      struct s_nation *saventn=curntn;
  1002. X      int i,j,x,y,armynum;
  1003. X  
  1004. X!     x = ntn[nation].capx;
  1005. X!     y = ntn[nation].capy;
  1006. X!     if((sct[x][y].designation==DCAPITOL)&&((sct[x][y].owner==nation)
  1007. X      ||(sct[x][y].owner==0)||(!isntn(ntn[sct[x][y].owner].active))))
  1008. X          return;
  1009. X  
  1010. X!     curntn = &ntn[nation];
  1011. X!     fprintf(fnews,"1.\tNation %s is depleted by the lack of a Capitol\n",ntn[nation].name);
  1012. X  
  1013. X      for(armynum=0;armynum<MAXARM;armynum++) if (P_ASOLD>0) {
  1014. X          /* first disband PDEPLETE% of the military */
  1015. X***************
  1016. X*** 788,802 ****
  1017. X          (rand()%100<PDEPLETE||P_ATYPE==A_MERCENARY)) {
  1018. X              if(P_ATYPE==A_MERCENARY) {
  1019. X                  MERCMEN += P_ASOLD;
  1020. X!             } else if(ntn[sct[AXLOC][AYLOC].owner].race==ntn[country].race) {
  1021. X                  sct[P_AXLOC][P_AYLOC].people += P_ASOLD;
  1022. X              }
  1023. X              P_ASOLD=0;
  1024. X              if(ispc(curntn->active)) {
  1025. X!                 if (mailopen(country)!=(-1)) {
  1026. X                      fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1027. X                      fprintf(fm,"\tYour %s Army %d disperses into the population\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  1028. X!                     mailclose(country);
  1029. X                  }
  1030. X              }
  1031. X          } else if(P_ATYPE>=MINMONSTER) {
  1032. X--- 798,812 ----
  1033. X          (rand()%100<PDEPLETE||P_ATYPE==A_MERCENARY)) {
  1034. X              if(P_ATYPE==A_MERCENARY) {
  1035. X                  MERCMEN += P_ASOLD;
  1036. X!             } else if(ntn[sct[AXLOC][AYLOC].owner].race==ntn[nation].race) {
  1037. X                  sct[P_AXLOC][P_AYLOC].people += P_ASOLD;
  1038. X              }
  1039. X              P_ASOLD=0;
  1040. X              if(ispc(curntn->active)) {
  1041. X!                 if (mailopen(nation)!=(-1)) {
  1042. X                      fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1043. X                      fprintf(fm,"\tYour %s Army %d disperses into the population\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  1044. X!                     mailclose(nation);
  1045. X                  }
  1046. X              }
  1047. X          } else if(P_ATYPE>=MINMONSTER) {
  1048. X***************
  1049. X*** 803,812 ****
  1050. X              /* disbanding of ALL monsters should take place */
  1051. X              P_ASOLD=0;
  1052. X              if(ispc(curntn->active)) {
  1053. X!                 if (mailopen(country)!=(-1)) {
  1054. X                      fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1055. X                      fprintf(fm,"\tYour %s (unit %d) leaves due to the loss of your jewels.\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  1056. X!                     mailclose(country);
  1057. X                  }
  1058. X              }
  1059. X          }
  1060. X--- 813,822 ----
  1061. X              /* disbanding of ALL monsters should take place */
  1062. X              P_ASOLD=0;
  1063. X              if(ispc(curntn->active)) {
  1064. X!                 if (mailopen(nation)!=(-1)) {
  1065. X                      fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1066. X                      fprintf(fm,"\tYour %s (unit %d) leaves due to the loss of your jewels.\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  1067. X!                     mailclose(nation);
  1068. X                  }
  1069. X              }
  1070. X          }
  1071. X***************
  1072. X*** 815,827 ****
  1073. X      /* check for sectors breaking away -- not capx, capy */
  1074. X      if(ispc(curntn->active)) {
  1075. X          /* create a summarized mail message of sectors effected */
  1076. X!         if (mailopen(country)!=(1)) {
  1077. X              fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1078. X              fprintf(fm,"Riots and Rebellion flourish:\n");
  1079. X          }
  1080. X      }
  1081. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++)
  1082. X!     if(sct[i][j].owner==country && (i!=x || j!=y) ) {
  1083. X          if(rand()%100 < PDEPLETE && sct[x][y].people>0) {
  1084. X              if(rand()%100 < PDEPLETE) {
  1085. X                  /* sector riots */
  1086. X--- 825,837 ----
  1087. X      /* check for sectors breaking away -- not capx, capy */
  1088. X      if(ispc(curntn->active)) {
  1089. X          /* create a summarized mail message of sectors effected */
  1090. X!         if (mailopen(nation)!=(1)) {
  1091. X              fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  1092. X              fprintf(fm,"Riots and Rebellion flourish:\n");
  1093. X          }
  1094. X      }
  1095. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++)
  1096. X!     if(sct[i][j].owner==nation && (i!=x || j!=y) ) {
  1097. X          if(rand()%100 < PDEPLETE && sct[x][y].people>0) {
  1098. X              if(rand()%100 < PDEPLETE) {
  1099. X                  /* sector riots */
  1100. X***************
  1101. X*** 844,852 ****
  1102. X          }
  1103. X      }
  1104. X      if(ispc(curntn->active)) {
  1105. X!         mailclose(country);
  1106. X      } else if(isnpc(curntn->active)) {
  1107. X!         if(sct[curntn->capx][curntn->capy].owner==country) {
  1108. X              /* reset capitol for npcs */
  1109. X              sct[curntn->capx][curntn->capy].designation=DCAPITOL;
  1110. X              if(sct[curntn->capx][curntn->capy].fortress<1)
  1111. X--- 854,862 ----
  1112. X          }
  1113. X      }
  1114. X      if(ispc(curntn->active)) {
  1115. X!         mailclose(nation);
  1116. X      } else if(isnpc(curntn->active)) {
  1117. X!         if(sct[curntn->capx][curntn->capy].owner==nation) {
  1118. X              /* reset capitol for npcs */
  1119. X              sct[curntn->capx][curntn->capy].designation=DCAPITOL;
  1120. X              if(sct[curntn->capx][curntn->capy].fortress<1)
  1121. X***************
  1122. X*** 860,880 ****
  1123. X  
  1124. X  /*routine to sack a nation's captiol */
  1125. X  void
  1126. X! sackem(country)
  1127. X!     int country;
  1128. X  {
  1129. X      struct s_nation *saventn=curntn;
  1130. X      int x,y,i,j,foundcap,nation;
  1131. X  
  1132. X      /* hail the conquerer */
  1133. X!     curntn = &ntn[country];
  1134. X      x = curntn->capx;
  1135. X      y = curntn->capy;
  1136. X      nation = sct[x][y].owner;
  1137. X!     if(nation==country || nation==0) return;
  1138. X  
  1139. X      /* advertise */
  1140. X!     fprintf(fnews,"1.\tCapitol of %s sacked by %s\n",ntn[country].name,ntn[nation].name);
  1141. X  
  1142. X      /* first give all prizes to the conquerer */
  1143. X      if(curntn->tgold > 0) {            /* all gold */
  1144. X--- 870,890 ----
  1145. X  
  1146. X  /*routine to sack a nation's captiol */
  1147. X  void
  1148. X! sackem(cntry)
  1149. X!     int cntry;
  1150. X  {
  1151. X      struct s_nation *saventn=curntn;
  1152. X      int x,y,i,j,foundcap,nation;
  1153. X  
  1154. X      /* hail the conquerer */
  1155. X!     curntn = &ntn[cntry];
  1156. X      x = curntn->capx;
  1157. X      y = curntn->capy;
  1158. X      nation = sct[x][y].owner;
  1159. X!     if(nation==cntry || nation==0) return;
  1160. X  
  1161. X      /* advertise */
  1162. X!     fprintf(fnews,"1.\tCapitol of %s sacked by %s\n",ntn[cntry].name,ntn[nation].name);
  1163. X  
  1164. X      /* first give all prizes to the conquerer */
  1165. X      if(curntn->tgold > 0) {            /* all gold */
  1166. X***************
  1167. X*** 894,900 ****
  1168. X              sct[x][y].designation = DCITY;
  1169. X          } else {
  1170. X              DEVASTATE(x,y);
  1171. X!             sct[x][y].owner=country;
  1172. X          }
  1173. X      }
  1174. X  
  1175. X--- 904,910 ----
  1176. X              sct[x][y].designation = DCITY;
  1177. X          } else {
  1178. X              DEVASTATE(x,y);
  1179. X!             sct[x][y].owner=cntry;
  1180. X          }
  1181. X      }
  1182. X  
  1183. X***************
  1184. X*** 902,908 ****
  1185. X      /* sacking does not occur next update for same sacking.   */
  1186. X      foundcap=FALSE;
  1187. X      for(i=0;foundcap==FALSE && i<MAPX;i++)
  1188. X!     for(j=0;foundcap==FALSE && j<MAPY;j++) if(sct[i][j].owner==country) {
  1189. X          if(sct[i][j].designation==DCITY) {
  1190. X              x = i; y = j;
  1191. X              foundcap=TRUE;
  1192. X--- 912,918 ----
  1193. X      /* sacking does not occur next update for same sacking.   */
  1194. X      foundcap=FALSE;
  1195. X      for(i=0;foundcap==FALSE && i<MAPX;i++)
  1196. X!     for(j=0;foundcap==FALSE && j<MAPY;j++) if(sct[i][j].owner==cntry) {
  1197. X          if(sct[i][j].designation==DCITY) {
  1198. X              x = i; y = j;
  1199. X              foundcap=TRUE;
  1200. X***************
  1201. X*** 918,930 ****
  1202. X      if ((x!=curntn->capx)||(y!=curntn->capy)) {
  1203. X          /* assign new pseudo capitol */
  1204. X          if(ispc(curntn->active)) {
  1205. X!             if(mailopen(country)!=(-1)) {
  1206. X!             fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  1207. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  1208. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  1209. X              fprintf(fm,"\tA temporary headquarters is now in sector %d,%d,\n",x,y);
  1210. X              fprintf(fm,"\t but designation of a new Capitol is recommended.\n");
  1211. X!             mailclose(country);
  1212. X              }
  1213. X          }
  1214. X          curntn->capx=x;
  1215. X--- 928,940 ----
  1216. X      if ((x!=curntn->capx)||(y!=curntn->capy)) {
  1217. X          /* assign new pseudo capitol */
  1218. X          if(ispc(curntn->active)) {
  1219. X!             if(mailopen(cntry)!=(-1)) {
  1220. X!             fprintf(fm,"Message to %s from Conquer\n\n",ntn[cntry].name);
  1221. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  1222. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  1223. X              fprintf(fm,"\tA temporary headquarters is now in sector %d,%d,\n",x,y);
  1224. X              fprintf(fm,"\t but designation of a new Capitol is recommended.\n");
  1225. X!             mailclose(cntry);
  1226. X              }
  1227. X          }
  1228. X          curntn->capx=x;
  1229. X***************
  1230. X*** 932,944 ****
  1231. X      } else {
  1232. X          /* no new capitol assignment */
  1233. X          if(ispc(curntn->active)) {
  1234. X!             if(mailopen(country)!=(-1)) {
  1235. X!             fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  1236. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  1237. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  1238. X              fprintf(fm,"\tNo other land remains.  The destruction\n");
  1239. X              fprintf(fm,"\t of your nation seems imminent.\n");
  1240. X!             mailclose(country);
  1241. X              }
  1242. X          }
  1243. X      }
  1244. X--- 942,954 ----
  1245. X      } else {
  1246. X          /* no new capitol assignment */
  1247. X          if(ispc(curntn->active)) {
  1248. X!             if(mailopen(cntry)!=(-1)) {
  1249. X!             fprintf(fm,"Message to %s from Conquer\n\n",ntn[cntry].name);
  1250. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  1251. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  1252. X              fprintf(fm,"\tNo other land remains.  The destruction\n");
  1253. X              fprintf(fm,"\t of your nation seems imminent.\n");
  1254. X!             mailclose(cntry);
  1255. X              }
  1256. X          }
  1257. X      }
  1258. X***************
  1259. X*** 949,956 ****
  1260. X  
  1261. X  /*destroy nation--special case if capitol not owned by other nation*/
  1262. X  void
  1263. X! destroy(country)
  1264. X! int country;
  1265. X  {
  1266. X      short armynum, nvynum;
  1267. X      int i, x, y;
  1268. X--- 959,966 ----
  1269. X  
  1270. X  /*destroy nation--special case if capitol not owned by other nation*/
  1271. X  void
  1272. X! destroy(cntry)
  1273. X! int cntry;
  1274. X  {
  1275. X      short armynum, nvynum;
  1276. X      int i, x, y;
  1277. X***************
  1278. X*** 957,976 ****
  1279. X      char buf[LINELTH];
  1280. X      struct s_nation    *nptr;
  1281. X  
  1282. X!     nptr = &ntn[country];
  1283. X!     if( ismonst(nptr->active) ) return;
  1284. X      if( !isactive(nptr->active) ) return;
  1285. X!     fprintf(fnews,"1.\tNation %s was destroyed ",nptr->name);
  1286. X!     if(country!=sct[nptr->capx][nptr->capy].owner){
  1287. X!         fprintf(fnews,"(their capitol is now owned by %s)\n",ntn[sct[nptr->capx][nptr->capy].owner].name);
  1288. X!         /*get +5% to combat skill*/
  1289. X!         ntn[sct[nptr->capx][nptr->capy].owner].aplus+=5;
  1290. X      }
  1291. X-     else fprintf(fnews,"(they owned their capitol)\n");
  1292. X  
  1293. X      nptr->active=INACTIVE;
  1294. X      nptr->score=0;
  1295. X!     sprintf(buf,"%s%d",msgfile,country);
  1296. X      unlink(buf);
  1297. X  
  1298. X      for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0) {
  1299. X--- 967,988 ----
  1300. X      char buf[LINELTH];
  1301. X      struct s_nation    *nptr;
  1302. X  
  1303. X!     nptr = &ntn[cntry];
  1304. X      if( !isactive(nptr->active) ) return;
  1305. X! 
  1306. X!     if( !ismonst(nptr->active) ) {
  1307. X!         fprintf(fnews,"1.\tNation %s was destroyed ",nptr->name);
  1308. X!         if(cntry!=sct[nptr->capx][nptr->capy].owner){
  1309. X!             fprintf(fnews,"(their capitol is now owned by %s)\n",ntn[sct[nptr->capx][nptr->capy].owner].name);
  1310. X!             /*get +5% to combat skill*/
  1311. X!             ntn[sct[nptr->capx][nptr->capy].owner].aplus+=5;
  1312. X!         }
  1313. X!         else fprintf(fnews,"(they owned their capitol)\n");
  1314. X      }
  1315. X  
  1316. X      nptr->active=INACTIVE;
  1317. X      nptr->score=0;
  1318. X!     sprintf(buf,"%s%d",msgfile,cntry);
  1319. X      unlink(buf);
  1320. X  
  1321. X      for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0) {
  1322. X***************
  1323. X*** 985,1000 ****
  1324. X      }
  1325. X      for(i=0;i<NTOTAL;i++) {
  1326. X          if (ntn[i].active < NPC_PEASANT ) {
  1327. X!             ntn[i].dstatus[country]=UNMET;
  1328. X              nptr->dstatus[i]=UNMET;
  1329. X          } else {
  1330. X!             ntn[i].dstatus[country]=WAR;
  1331. X              nptr->dstatus[i]=WAR;
  1332. X          }
  1333. X      }
  1334. X      
  1335. X      /*if take them you get their gold*/
  1336. X!     if(country!=sct[nptr->capx][nptr->capy].owner){
  1337. X          if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
  1338. X          if(nptr->jewels>0) ntn[sct[nptr->capx][nptr->capy].owner].jewels+=nptr->jewels;
  1339. X          if(nptr->metals>0) ntn[sct[nptr->capx][nptr->capy].owner].metals+=nptr->metals;
  1340. X--- 997,1012 ----
  1341. X      }
  1342. X      for(i=0;i<NTOTAL;i++) {
  1343. X          if (ntn[i].active < NPC_PEASANT ) {
  1344. X!             ntn[i].dstatus[cntry]=UNMET;
  1345. X              nptr->dstatus[i]=UNMET;
  1346. X          } else {
  1347. X!             ntn[i].dstatus[cntry]=WAR;
  1348. X              nptr->dstatus[i]=WAR;
  1349. X          }
  1350. X      }
  1351. X      
  1352. X      /*if take them you get their gold*/
  1353. X!     if(cntry!=sct[nptr->capx][nptr->capy].owner){
  1354. X          if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
  1355. X          if(nptr->jewels>0) ntn[sct[nptr->capx][nptr->capy].owner].jewels+=nptr->jewels;
  1356. X          if(nptr->metals>0) ntn[sct[nptr->capx][nptr->capy].owner].metals+=nptr->metals;
  1357. X***************
  1358. X*** 1003,1011 ****
  1359. X      }
  1360. X  
  1361. X      /*if god destroys then kill all population*/
  1362. X!     if(country==sct[nptr->capx][nptr->capy].owner){
  1363. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1364. X!         if(sct[x][y].owner==country) {
  1365. X              sct[x][y].people=0;
  1366. X              sct[x][y].owner=0;
  1367. X              sct[x][y].designation=DNODESIG;
  1368. X--- 1015,1023 ----
  1369. X      }
  1370. X  
  1371. X      /*if god destroys then kill all population*/
  1372. X!     if(cntry==sct[nptr->capx][nptr->capy].owner){
  1373. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1374. X!         if(sct[x][y].owner==cntry) {
  1375. X              sct[x][y].people=0;
  1376. X              sct[x][y].owner=0;
  1377. X              sct[x][y].designation=DNODESIG;
  1378. X***************
  1379. X*** 1014,1020 ****
  1380. X      /*slowly take over and all people flee*/
  1381. X      else if(ntn[sct[nptr->capx][nptr->capy].owner].race!=nptr->race){
  1382. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1383. X!         if(sct[x][y].owner==country) {
  1384. X              /*all kinds of refugees to neighboring countries*/
  1385. X              flee(x,y,TRUE,FALSE);
  1386. X              sct[x][y].people=0;
  1387. X--- 1026,1032 ----
  1388. X      /*slowly take over and all people flee*/
  1389. X      else if(ntn[sct[nptr->capx][nptr->capy].owner].race!=nptr->race){
  1390. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1391. X!         if(sct[x][y].owner==cntry) {
  1392. X              /*all kinds of refugees to neighboring countries*/
  1393. X              flee(x,y,TRUE,FALSE);
  1394. X              sct[x][y].people=0;
  1395. X***************
  1396. X*** 1027,1033 ****
  1397. X      /*else same race, so give all land to conqueror*/
  1398. X      else {
  1399. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1400. X!         if(sct[x][y].owner==country){
  1401. X              sct[x][y].owner=sct[nptr->capx][nptr->capy].owner;
  1402. X              if( !ISCITY( sct[x][y].designation )) {
  1403. X              if(tofood( &sct[x][y],0)<DESFOOD)
  1404. X--- 1039,1045 ----
  1405. X      /*else same race, so give all land to conqueror*/
  1406. X      else {
  1407. X          for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++)
  1408. X!         if(sct[x][y].owner==cntry){
  1409. X              sct[x][y].owner=sct[nptr->capx][nptr->capy].owner;
  1410. X              if( !ISCITY( sct[x][y].designation )) {
  1411. X              if(tofood( &sct[x][y],0)<DESFOOD)
  1412. X***************
  1413. X*** 1036,1042 ****
  1414. X              }
  1415. X          }
  1416. X      }
  1417. X-     return;
  1418. X  }
  1419. X  
  1420. X  #define ALPHA_SIZE    128
  1421. X--- 1048,1053 ----
  1422. X***************
  1423. X*** 1044,1051 ****
  1424. X  /*movecost contains movement cost unless water  -1 or unenterable land (-2)*/
  1425. X  /* if water and not ajacent to land will cost -4*/
  1426. X  void
  1427. X! updmove(race,country)
  1428. X! int country;
  1429. X  char race;
  1430. X  {
  1431. X      register struct s_sector    *sptr;
  1432. X--- 1055,1062 ----
  1433. X  /*movecost contains movement cost unless water  -1 or unenterable land (-2)*/
  1434. X  /* if water and not ajacent to land will cost -4*/
  1435. X  void
  1436. X! updmove(race,cntry)
  1437. X! int cntry;
  1438. X  char race;
  1439. X  {
  1440. X      register struct s_sector    *sptr;
  1441. X***************
  1442. X*** 1077,1083 ****
  1443. X          } /* switch */
  1444. X      } /* for */
  1445. X  
  1446. X!     if((magic(country,DERVISH)==1) ||(magic(country,DESTROYER)==1)) {
  1447. X          veg_cost[ ICE ] = 1;
  1448. X          veg_cost[ DESERT ] = 1;
  1449. X      }
  1450. X--- 1088,1094 ----
  1451. X          } /* switch */
  1452. X      } /* for */
  1453. X  
  1454. X!     if((magic(cntry,DERVISH)==1) ||(magic(cntry,DESTROYER)==1)) {
  1455. X          veg_cost[ ICE ] = 1;
  1456. X          veg_cost[ DESERT ] = 1;
  1457. X      }
  1458. X***************
  1459. X*** 1337,1343 ****
  1460. X      while(!done) {
  1461. X          ch=getch();
  1462. X          if (isprint(ch)) {
  1463. X!             if (count<NAMELTH+1) {
  1464. X                  /* only input displayable characters */
  1465. X                  addch(ch);
  1466. X                  refresh();
  1467. X--- 1348,1354 ----
  1468. X      while(!done) {
  1469. X          ch=getch();
  1470. X          if (isprint(ch)) {
  1471. X!             if (count<NAMELTH) {
  1472. X                  /* only input displayable characters */
  1473. X                  addch(ch);
  1474. X                  refresh();
  1475. X***************
  1476. X*** 1391,1401 ****
  1477. X          for (i=0;i<l;i++) {
  1478. X              ch=name[i];
  1479. X              if(ch < '0' || ch > '9' ) {
  1480. X!                 getyx(stdscr,i,l);
  1481. X!                 mvprintw(i+1,0,"Invalid Nation <%s> -- hit any key",name);
  1482. X!                 clrtoeol();
  1483. X!                 refresh();
  1484. X!                 getch();
  1485. X                  return(NTOTAL);
  1486. X              } else {
  1487. X                  hold *= 10;
  1488. X--- 1402,1408 ----
  1489. X          for (i=0;i<l;i++) {
  1490. X              ch=name[i];
  1491. X              if(ch < '0' || ch > '9' ) {
  1492. X!                 errormsg("There is no nation by that name.");
  1493. X                  return(NTOTAL);
  1494. X              } else {
  1495. X                  hold *= 10;
  1496. X***************
  1497. X*** 1408,1425 ****
  1498. X      return(hold);
  1499. X  }
  1500. X  
  1501. X- extern short country;
  1502. X  /* finds a nation for god to be, returns 1 on failure */
  1503. X  int
  1504. X  get_god()
  1505. X  {
  1506. X!     clear();
  1507. X!     mvaddstr(0,0,"SUPER USER; FOR WHAT NATION: ");
  1508. X      refresh();
  1509. X  
  1510. X      /* return on no entry or bad entry */
  1511. X      if ((country=get_country())==(-1) || country==NTOTAL) {
  1512. X          country = 0;
  1513. X          return(1);
  1514. X      }
  1515. X  
  1516. X--- 1415,1433 ----
  1517. X      return(hold);
  1518. X  }
  1519. X  
  1520. X  /* finds a nation for god to be, returns 1 on failure */
  1521. X  int
  1522. X  get_god()
  1523. X  {
  1524. X!     clear_bottom(0);
  1525. X!     mvaddstr(LINES-4,0,"Super User; For what nation? ");
  1526. X      refresh();
  1527. X  
  1528. X      /* return on no entry or bad entry */
  1529. X      if ((country=get_country())==(-1) || country==NTOTAL) {
  1530. X          country = 0;
  1531. X+         redraw=DONE;
  1532. X+         makebottom();
  1533. X          return(1);
  1534. X      }
  1535. X  
  1536. X***************
  1537. X*** 1468,1495 ****
  1538. X  int
  1539. X  mailopen(to)
  1540. X  {
  1541. X      char    line[LINELTH];
  1542. X      if(mailok != DONEMAIL) mailclose(ABORTMAIL);
  1543. X  
  1544. X      if (to != NEWSMAIL) {
  1545. X  #ifdef CONQUER
  1546. X          /* check if the player is currently reading messages */
  1547. X          sprintf(line,"%s%hd.tmp",msgfile,to);
  1548. X!         if (access(line,00)==0) {
  1549. X!             if (to>0 && to<NTOTAL) {
  1550. X!                 sprintf(line,"Nation %s is reading their mail... try again later.", ntn[to].name);
  1551. X!                 errormsg(line);
  1552. X              }
  1553. X-             return(-1);
  1554. X          }
  1555. X  
  1556. X          /* otherwise continue; checking for others */
  1557. X          /* this file name is also used in rmessages() */
  1558. X          sprintf(tmp_mail_name,"send.%s%hd",msgfile,to);
  1559. X!         if (access(tmp_mail_name,00)==0) {
  1560. X!             if (to>=0 && to<NTOTAL)
  1561. X!             errormsg("Someone is already sending mail to Nation %s... try again later.", ntn[to].name);
  1562. X!             return(-1);
  1563. X          }
  1564. X  #endif /*CONQUER*/
  1565. X  #ifdef ADMIN
  1566. X--- 1476,1522 ----
  1567. X  int
  1568. X  mailopen(to)
  1569. X  {
  1570. X+ #ifdef CONQUER
  1571. X      char    line[LINELTH];
  1572. X+ #endif /*CONQUER*/
  1573. X      if(mailok != DONEMAIL) mailclose(ABORTMAIL);
  1574. X  
  1575. X      if (to != NEWSMAIL) {
  1576. X  #ifdef CONQUER
  1577. X+         struct stat fst;
  1578. X          /* check if the player is currently reading messages */
  1579. X          sprintf(line,"%s%hd.tmp",msgfile,to);
  1580. X!         if (stat(line,&fst)==0) {
  1581. X!             long now;
  1582. X!             now = time(0);
  1583. X!             if (now - fst.st_mtime < TIME_DEAD) {
  1584. X!                 if (to>=0 && to<NTOTAL) {
  1585. X!                     sprintf(line,"Nation %s is reading their mail... try again later.", ntn[to].name);
  1586. X!                     errormsg(line);
  1587. X!                 }
  1588. X!                 return(-1);
  1589. X!             } else {
  1590. X!                 /* remove useless file */
  1591. X!                 unlink(line);
  1592. X              }
  1593. X          }
  1594. X  
  1595. X          /* otherwise continue; checking for others */
  1596. X          /* this file name is also used in rmessages() */
  1597. X          sprintf(tmp_mail_name,"send.%s%hd",msgfile,to);
  1598. SHAR_EOF
  1599. echo "End of part 1"
  1600. echo "File patchV4.7 is continued in part 2"
  1601. echo "2" > s2_seq_.tmp
  1602. exit 0
  1603.  
  1604.